<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head th:replace="layouts::header"></head>

<body>
<nav th:replace="layouts::navbar"></nav>
<div class="container">
    <form th:action="@{/newBooks/save}" th:object="${newBook}" method="POST">
        <input type="hidden" th:field="*{newBookId}">

        <div class="form-group">
            <div class="col-sm-3">
                名称：<input type="text" placeholder="图书名称" required th:field="*{name}"><br>
                类型：<input type="text" placeholder="图书类型" required th:field="*{type}"><br>
                编号：<input type="text" placeholder="图书编号" required th:field="*{number}"><br>
            </div>

        </div>


        <div class="form-group">
            <div class="col-sm-6">
                <select class="form-control" th:field="*{userAccounts}" multiple="multiple">
                    <option th:each="userAccount: ${allUserAccounts}" th:value="${userAccount.userAccountId}" th:text="${userAccount.userName}"}></option>
                </select>
            </div>
        </div>

        <input type="hidden" name="_csrf" th:value="${_csrf.token}" />

        <div>
            <button type="submit" class="glyphicon glyphicon-book" style="color: rgb(212, 106, 64);" >&nbsp;新增图书</button>
        </div>

    </form>
</div>

</body>
</html>

